//
//  SelectPayCardDetailView.m
//  YTwallet
//
//  Created by ZhangLin on 2019/4/16.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "SelectPayCardDetailView.h"
#import <Masonry.h>
@implementation SelectPayCardDetailView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupViews];
    }
    return self;
}

-(void)setupViews
{
    self.backgroundColor = [UIColor clearColor];
    
    self.backgroundView = [[UIView alloc] initWithFrame:(CGRectMake(0, ETScreenH - 400, ETScreenW, 400))];
    self.backgroundView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.backgroundView];
    
    
    self.topView = [[UIView alloc] init];
    self.topView.backgroundColor = [UIColor whiteColor];
    self.topView.frame = CGRectMake(0, 0, ETScreenW, 44);
    [self.backgroundView addSubview:self.topView];
    
    self.tipsLab = [[UILabel alloc] init];
    self.tipsLab.text = @"选择付款卡";
    self.tipsLab.textColor = ETColorWithRGB(51, 51, 51);
    self.tipsLab.font = [UIFont boldSystemFontOfSize:16];
    [self.topView addSubview:self.tipsLab];
    [self.tipsLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.centerY.equalTo(self.topView);
    }];
    
    self.delBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.delBtn setImage:[UIImage imageNamed:@"icon_off"] forState:(UIControlStateNormal)];
    [self.topView addSubview:self.delBtn];
    [self.delBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-15);
        make.centerY.equalTo(self.topView);
        make.width.mas_equalTo(16);
        make.height.mas_equalTo(16);
    }];
    
    self.lineView = [[UIView alloc] init];
    self.lineView.backgroundColor = ETTableViewLineColor;
    [self.topView addSubview:self.lineView];
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.bottom.equalTo(self.topView);
        make.height.mas_equalTo(ETTableViewLineHeight);
    }];
    
    self.payCardTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 44, ETScreenW, 400 - 44) style:(UITableViewStyleGrouped)];
    self.payCardTableView.backgroundColor =[UIColor whiteColor];
    [self.backgroundView addSubview:self.payCardTableView];
}

@end
